import pymysql
fp=open(r'C:\Users\CHX\Desktop\1.jpg','rb')
img=fp.read()
fp.close()
con=pymysql.connect(database='web', host='localhost', user='root', password='root')
cursor = con.cursor()
sql = "INSERT INTO product_info VALUES  (%s,%s,%s,%s);"
args = ('1','1','1',img)
con.commit()
cursor.close()
con.close()